<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Automating Winamp</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>

<body>
<h1>Automating Winamp</h1>

<p>This section demonstrates how to control Winamp via hotkey even when it is minimized or inactive. This information has been tested with Winamp 2.78c but should work for other major releases as well. Please post changes and improvements in the forum or contact the author.</p>
<p>This example makes the Ctrl+Alt+P hotkey equivalent to pressing Winamp's pause/unpause button:</p>
<pre>^!p::
IfWinNotExist ahk_class Winamp v1.x
    return
<em>; Otherwise, the above has set the &quot;last found&quot; window for use below.</em>
<a href="../commands/ControlSend.htm">ControlSend</a>, ahk_parent, c  <em>; Pause/Unpause</em>
return</pre>
<p>Here are some of the keyboard shortcuts available in Winamp 2.x (may work in other versions too). The above example can be revised to use any of these keys:</p>
<table class="info" style="width:50%">
  <tr>
    <th>Key to send</th>
    <th>Effect</th>
  </tr>
  <tr>
    <td>c</td>
    <td>Pause/UnPause</td>
  </tr>
  <tr>
    <td>x</td>
    <td>Play/Restart/UnPause</td>
  </tr>
  <tr>
    <td width="29%">v</td>
    <td width="71%">Stop</td>
  </tr>
  <tr>
    <td>+v</td>
    <td>Stop with Fadeout</td>
  </tr>
  <tr>
    <td>^v</td>
    <td>Stop after the current track</td>
  </tr>
  <tr>
    <td>b</td>
    <td>Next Track</td>
  </tr>
  <tr>
    <td>z</td>
    <td>Previous Track</td>
  </tr>
  <tr>
    <td>{left}</td>
    <td>Rewind 5 seconds</td>
  </tr>
  <tr>
    <td>{right}</td>
    <td>Fast-forward 5 seconds</td>
  </tr>
  <tr>
    <td>{up}</td>
    <td>Turn Volume Up</td>
  </tr>
  <tr>
    <td>{down}</td>
    <td>Turn Volume Down</td>
  </tr>
</table>
<p>&nbsp;</p>
<pre>
<em>; This next example asks Winamp which track number is currently active:</em>
<a href="../commands/PostMessage.htm">SendMessage</a>, 1024, 0, 120, ahk_class Winamp v1.x
if ErrorLevel &lt;&gt; FAIL
{
    ErrorLevel += 1  <em>; Winamp's count starts at 0, so adjust by 1.</em>
    MsgBox, Track #%ErrorLevel% is active or playing.
}</pre>
</body>
</html>
